<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三角形</title>
</head>
<body>
    <script>
        /* 打印三角形：第一行一个，第二行两个，.....第j行i个 */

        //在第j行打印换行符
        for(var j = 1;j <= 10;j++){
            //在j行内打印i个*，直到i=j
            for(var i = 1;i <= j;i++){
                document.write('*');
            }
            document.write('<br/>');
        }
    </script>
</body>
</html>